class InsertSort:
    def __init__(self, list_target):
        self.__list = list_target

    def sort(self):
        for i in range(1, len(self.__list)):
            x = self.__list[i]
            j = i
            while j > 0 and self.__list[j - 1] > x:
                self.__list[j] = self.__list[j - 1]
                j -= 1
            self.__list[j] = x

    def print(self):
        for item in self.__list:
            print(item, end=' ')
        print()


if __name__ == '__main__':
    insert_sort = InsertSort([43, 4, 5, 2, 42, 89, 32, 67, 96])
    insert_sort.sort()
    insert_sort.print()
